package cn.kazuz.service.login.service.impl;

import cn.kazuz.service.login.entity.AdminLogin;
import cn.kazuz.service.login.mapper.AdminInfoMapper;
import cn.kazuz.service.login.service.AdminInfoService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.NonNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@SuppressWarnings({"all"})
@Service
public class AdminInfoServiceImpl extends ServiceImpl<AdminInfoMapper, AdminLogin>
		implements AdminInfoService {

	@Autowired
	private AdminInfoMapper adminInfoMapper;

	@Override
	public Boolean isExistByIdAndName(@NonNull String adminId, @NonNull String adminUsername) {
		QueryWrapper<AdminLogin> wrapper = new QueryWrapper<>();
		wrapper.eq("ADMIN_ID", adminId);
		wrapper.eq("ADMIN_USERNAME", adminUsername);
		return adminInfoMapper.exists(wrapper);
	}
}
